package com.kwq.email.controller;

import com.kwq.email.pojo.email;
import com.kwq.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/email")
public class EmialController {

    @Autowired
    EmailService emailService;
    @PostMapping("/sendEmail")
    public void sendEmail(@RequestBody email e){
        emailService.sendEmail(e.getAcceptor(),e.getTitle(),e.getContent());
    }


}
